Skip to content

[RFC] pkgconf#59980

Draft
Duncaen wants to merge 3 commits intovoid-linux:masterfrom
Duncaen:pkgconf
Draft

[RFC] pkgconf#59980
Duncaen wants to merge 3 commits intovoid-linux:masterfrom
Duncaen:pkgconf

Conversation

@Duncaen
Copy link
Copy Markdown
Member

@Duncaen Duncaen commented Apr 16, 2026

[ci skip][skip ci]

As an alternative to #59948, instead of making pkg-config the default make pkgconf the default. This PR is to track and figure out what would need to be changed and possibly fixed.

Current major issues would be pkgconf adding the sysroot path to all variables, including things like host_bins which breaks some packages using pkg-config to look up those variables.

Fix would probably to separate those pkg-config calls to actually use PKG_CONFIG_FOR_BUILD instead of PKG_CONFIG.

Duncaen added 3 commits April 16, 2026 17:30
Those are supposed to be architecture independent as far as I know.
Without that change xorg-util-macros would be required in hostmakedepends
and makedepends.
@Duncaen Duncaen marked this pull request as draft April 16, 2026 15:54
@leahneukirchen
Copy link
Copy Markdown
Member

I think this is the way to forward, we may need to fix some .pc files however.

@JkktBkkt
Copy link
Copy Markdown
Contributor

Tried to build a bit with this, changing some templates to use pkgconf and building cross, focusing on qt5 as it's known to be problematic.

I've found a bunch of templates building just fine:

  • sddm (cmake)
  • supercollider (cmake)
  • retroarch (configure)
  • abGate (gnu-makefile)
  • modrana (gnu-makefile)
  • musescore (gnu-makefile)
  • smplayer (gnu-makefile)
  • recoll (meson)
  • OpenLP (python3-module)
  • ReText (python3-module)
  • qutebrowser (python3-module)
  • gpsd (scons)
  • trident-networkmgr (qmake)
  • vmap (qmake)

Some failed due to unrelated reasons:

  • gmic (can't find gimp, needs updating)
  • uim (tries to execute a binary it had just built, should be marked nocross — also not in repos for aarch64)

Some fail trying to run a binary from wrong prefix:

  • vlc (gnu-configure, tries to run qt5's moc / lrelease / etc.)
  • zbar (gnu-configure, tries to run glib-genmarshal for the target machine)
  • Carla (worked when I switched it to use qt6 instead)

/usr/lib/pkgconfig/glib-2.0.pc:

prefix=/usr
bindir=${prefix}/bin
datadir=${prefix}/share
includedir=${prefix}/include
libdir=${prefix}/lib64

glib_genmarshal=${bindir}/glib-genmarshal
gobject_query=${bindir}/gobject-query
glib_mkenums=${bindir}/glib-mkenums

With "export PKG_CONFIG_FDO_SYSROOT_RULES=1" added to the wrapper via common/hooks/pre-configure/02-script-wrapper.sh, vlc and zbar both built fine

This indeed breaks the default pkgconf behavior, but I also tested the templates that already have pkgconf defined in requirements, and everything except libportal, as discussed here worked.
To toggle between the two something like..

if [ -z "PKGCONF_SYSROOT_RULES" ]; then
    export PKG_CONFIG_FDO_SYSROOT_RULES=1;
fi

..might make sense in the pkg-config wrapper, so it's defaulting to the old behavior (that should be compatible with almost all templates)

Most notable, though, was the build failure of libreoffice.
It fails with both: pkgconf (as-is) and pkgconf (emulating pkg-config sysroot rules), with the same error:

checking for CLucene/analysis/cjk/CJKAnalyzer.h... no
configure: error: Your version of libclucene has contribs-lib missing.

But it works with pkg-config (as used currently).
Perhaps it'd be nice to retain the ability to switch a template to use one over the other if absolutely necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants